Optimal. Leaf size=35 \[ a A x+\frac {(A b+a B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b B \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3999, 3852, 8,
3855} \begin {gather*} \frac {(a B+A b) \tanh ^{-1}(\sin (c+d x))}{d}+a A x+\frac {b B \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3999
Rubi steps
\begin {align*} \int (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx &=a A x+(b B) \int \sec ^2(c+d x) \, dx+(A b+a B) \int \sec (c+d x) \, dx\\ &=a A x+\frac {(A b+a B) \tanh ^{-1}(\sin (c+d x))}{d}-\frac {(b B) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=a A x+\frac {(A b+a B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b B \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 43, normalized size = 1.23 \begin {gather*} a A x+\frac {A b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b B \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 57, normalized size = 1.63
method | result | size |
derivativedivides | \(\frac {A a \left (d x +c \right )+B a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B b \tan \left (d x +c \right )}{d}\) | \(57\) |
default | \(\frac {A a \left (d x +c \right )+B a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B b \tan \left (d x +c \right )}{d}\) | \(57\) |
norman | \(\frac {a A x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a A x -\frac {2 B b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\frac {\left (A b +B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {\left (A b +B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(102\) |
risch | \(a A x +\frac {2 i B b}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A b}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A b}{d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}\) | \(105\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 56, normalized size = 1.60 \begin {gather*} \frac {{\left (d x + c\right )} A a + B a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + A b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + B b \tan \left (d x + c\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 85 vs.
\(2 (35) = 70\).
time = 4.40, size = 85, normalized size = 2.43 \begin {gather*} \frac {2 \, A a d x \cos \left (d x + c\right ) + {\left (B a + A b\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B a + A b\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, B b \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 71 vs.
\(2 (32) = 64\).
time = 4.61, size = 71, normalized size = 2.03 \begin {gather*} \begin {cases} \frac {A a \left (c + d x\right ) + A b \log {\left (\tan {\left (c + d x \right )} + \sec {\left (c + d x \right )} \right )} + B a \log {\left (\tan {\left (c + d x \right )} + \sec {\left (c + d x \right )} \right )} + B b \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + B \sec {\left (c \right )}\right ) \left (a + b \sec {\left (c \right )}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 84 vs.
\(2 (35) = 70\).
time = 0.47, size = 84, normalized size = 2.40 \begin {gather*} \frac {{\left (d x + c\right )} A a + {\left (B a + A b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (B a + A b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.24, size = 114, normalized size = 3.26 \begin {gather*} \frac {2\,A\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {B\,b\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}-\frac {A\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________